﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace MDIDemo.Model
{
    public class StaticParamModel
    {
        public string paramName;
        public double defaultValue;
        public StaticParamModel(string paramName, double defaultValue)
        {
            this.paramName = paramName;
            this.defaultValue = defaultValue;
        }
    }
    public class Col1Model
    {
        public string batchId;
        public int address;
    }
    public class ParamDefaultMaxMinModel
    {
        public string id;//监测点编号
        public decimal defaultValue;
        public decimal MaxValue;
        public decimal MinValue;
    }
    public class MySqlParamerModel
    {
        public string ParamerName;
        public object ParamerValue;
        public MySqlDbType ParamerType;
        public MySqlParamerModel(string ParamerName,
        object ParamerValue,
        MySqlDbType ParamerType)
        {
            this.ParamerName = ParamerName;
            this.ParamerValue = ParamerValue;
            this.ParamerType = ParamerType;
        }
    }
    public class CRCModel
    {
        public char CRC16Lo;
        public char CRC16Hi;

        public CRCModel(char CRC16Lo, char CRC16Hi)
        {
            this.CRC16Hi = CRC16Hi;
            this.CRC16Lo = CRC16Lo;
        }
    }
    public class ValueModel
    {
        public DateTime dateTime;
        public double Value;
        public ValueModel(double Value, DateTime dateTime)
        {
            this.Value = Value;
            this.dateTime = dateTime;
        }
    }
    public class IniEquipmentDateModel : EventArgs
    {
        public int address;
        public int channel;
        public List<DataBatchModel> dataBatchModels;

        public void Clear()
        {
            if (dataBatchModels != null)
            {
                dataBatchModels.Clear();
                dataBatchModels = null;
            }
        }

    }
    public class DataBatchModel
    {
        public float waveValue;
        public float powerValue;
        public DataBatchModel(float waveValue, float powerValue)
        {
            this.waveValue = waveValue;
            this.powerValue = powerValue;
        }
    }

    public interface IoSocketClient
    {
        void SocketClientNewMessage(byte[] vs);
        void SocketClientStop(string message);
        void SocketServerDown(string ip, int port, string message);
    }

    public class SocketClientParamModel
    {
        public NetworkStream networkStream;
        public CancellationTokenSource cancellationTokenSource;
        public TcpClient tcpClient;
        private IoSocketClient ioSocketClient;

        public SocketClientParamModel(NetworkStream networkStream
            , CancellationTokenSource cancellationTokenSource
            , TcpClient tcpClient
            , IoSocketClient ioSocketClient)
        {
            this.networkStream = networkStream;
            this.cancellationTokenSource = cancellationTokenSource;
            this.tcpClient = tcpClient;
            this.ioSocketClient = ioSocketClient;
        }
    }
    public class LookUpEditColumnModel
    {
        public string FieldName;
        public string Caption;
        public LookUpEditColumnModel(string FieldName, string Caption)
        {
            this.FieldName = FieldName;
            this.Caption = Caption;
        }
    }
    public class ProjectTestModel
    {
        public string id;//监测点编号
        public string mainId;//项目ID
        public int depth;//深度
        public int depthMai;//埋深
        public int sortNo;//序号
        public string remark;//备注
    }
    public class ProjectPictureModel
    {
        public string id;//picture编号
        public string mainId;//项目ID
        public string fileName;
        public byte[] fileStream;
        public int sortNo;//序号
        public string remark;//备注
    }
    public class ProjectMainModel
    {
        public string id;
        public string projectName;
        public string projectAddress;
        public string projectManager;
        public string projectType;
        public string remark;
        public List<ProjectSubModel> projectSubModels;
    }
    public class ProjectSubModel
    {
        public string id;
        public string mainId;
        public string fileName;
        public string fileStream;
    }
    public class UseModel
    {
        public string id;
        public string nickName;
        public string useName;
        public string mobile;
    }
    public class StrongParaModel
    {
        public string englishAll;
        public string id;
        public string englishName;
        public string chinaName;
        public string paraType;
        public int smallPoint;
        public string site;
        public int sortNo;
        public string strongName;
        public string strongClass;
    }
    public class EquipmentModel
    {
        public string id;
        public string equipmentName;
        public string factoryName;
        public string ip;
        public string remark;
        public string equipmentType;
        public string port;
        public int sensorCount;
    }

    public class ComboboxEditModel
    {
        public string Caption;
        public bool IsSelect;
        public ComboboxEditModel()
        {
            IsSelect = false;
        }
    }
    public class PageSqlModel
    {
        public string PageSql;
        public string TotalSql;
    }
    public class Class_GridColumnModel
    {
        public string Name;
        public string Caption;
        public string FieldName;
        public int Width;
        public bool ReadOnly;
        public bool AllowFilter;
        public bool IsVisble;
        public bool IsGroup;
        public string orderType;
        public string DataType;
        public int Site;

        public Class_GridColumnModel()
        {
            Width = 80;
            ReadOnly = true;
            IsVisble = true;
            IsGroup = false;
        }

    }
    /// <summary>
    /// 数据字典
    /// </summary>
    public class Class_Dictionary
    {
        public string id { get; set; }
        public string signName { get; set; }
        public string contentName { get; set; }
        public bool defaultSelect { get; set; }
        public int sortNo { get; set; }
        public bool stopSign { get; set; }
        public string remark { get; set; }
    }

    public class NavBarModel
    {
        public string id;
        public string caption;
        public int imageIndex;
        public string hint;
    }

    public class DocModel
    {
        public string id;
        public string path;
        public string docName;
        public string docTitle;
        public string remark;
    }

    public class DocReplaceModel
    {
        public DocReplaceModel(string oldInfomation, string newInfomation)
        {
            this.newInfomation = newInfomation;
            this.oldInfomation = oldInfomation;
        }
        public string oldInfomation;
        public string newInfomation;
    }
}
